(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
app(cons(x, l), k) →+ cons(x, app(l, k))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1].
The pumping substitution is [l / cons(x, l)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0', y) → y
plus(s(x), y) → s(plus(x, y))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0', y) → y
plus(s(x), y) → s(plus(x, y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
app,
sum,
plusThey will be analysed ascendingly in the following order:
app < sum
plus < sum
(8) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
app, sum, plus
They will be analysed ascendingly in the following order:
app < sum
plus < sum
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
app(
gen_nil:cons3_0(
n6_0),
gen_nil:cons3_0(
b)) →
gen_nil:cons3_0(
+(
n6_0,
b)), rt ∈ Ω(1 + n6
0)
Induction Base:
app(gen_nil:cons3_0(0), gen_nil:cons3_0(b)) →RΩ(1)
gen_nil:cons3_0(b)
Induction Step:
app(gen_nil:cons3_0(+(n6_0, 1)), gen_nil:cons3_0(b)) →RΩ(1)
cons(0', app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b))) →IH
cons(0', gen_nil:cons3_0(+(b, c7_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
plus, sum
They will be analysed ascendingly in the following order:
plus < sum
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
plus(
gen_0':s4_0(
n636_0),
gen_0':s4_0(
b)) →
gen_0':s4_0(
+(
n636_0,
b)), rt ∈ Ω(1 + n636
0)
Induction Base:
plus(gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
gen_0':s4_0(b)
Induction Step:
plus(gen_0':s4_0(+(n636_0, 1)), gen_0':s4_0(b)) →RΩ(1)
s(plus(gen_0':s4_0(n636_0), gen_0':s4_0(b))) →IH
s(gen_0':s4_0(+(b, c637_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
plus(gen_0':s4_0(n636_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n636_0, b)), rt ∈ Ω(1 + n6360)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
sum
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sum(
gen_nil:cons3_0(
+(
1,
n1327_0))) →
gen_nil:cons3_0(
1), rt ∈ Ω(1 + n1327
0)
Induction Base:
sum(gen_nil:cons3_0(+(1, 0))) →RΩ(1)
cons(0', nil)
Induction Step:
sum(gen_nil:cons3_0(+(1, +(n1327_0, 1)))) →RΩ(1)
sum(cons(plus(0', 0'), gen_nil:cons3_0(n1327_0))) →LΩ(1)
sum(cons(gen_0':s4_0(+(0, 0)), gen_nil:cons3_0(n1327_0))) →IH
gen_nil:cons3_0(1)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(16) Complex Obligation (BEST)
(17) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
plus(gen_0':s4_0(n636_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n636_0, b)), rt ∈ Ω(1 + n6360)
sum(gen_nil:cons3_0(+(1, n1327_0))) → gen_nil:cons3_0(1), rt ∈ Ω(1 + n13270)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(19) BOUNDS(n^1, INF)
(20) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
plus(gen_0':s4_0(n636_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n636_0, b)), rt ∈ Ω(1 + n6360)
sum(gen_nil:cons3_0(+(1, n1327_0))) → gen_nil:cons3_0(1), rt ∈ Ω(1 + n13270)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(22) BOUNDS(n^1, INF)
(23) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
plus(gen_0':s4_0(n636_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n636_0, b)), rt ∈ Ω(1 + n6360)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
Types:
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
sum :: nil:cons → nil:cons
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
hole_nil:cons1_0 :: nil:cons
hole_0':s2_0 :: 0':s
gen_nil:cons3_0 :: Nat → nil:cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(0', gen_nil:cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n6_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(28) BOUNDS(n^1, INF)